#include <Rainbowduino_NooTe.h>

int g_iCurrentAnim = 0;
unsigned long g_ulOldTime=0;

void setup()
{
  Serial.begin(115200);
  Rb.init();
  delay(200);

  g_ulOldTime=millis();
  setAnim(g_iCurrentAnim);
}

void loop()
{
  static unsigned long g_ulChangeTime=0;
  unsigned long ulCurrentTime=millis();
  unsigned long ulTimeSlice = ulCurrentTime-g_ulOldTime;

  g_ulChangeTime += ulTimeSlice;
  g_ulOldTime = ulCurrentTime;

  if(g_ulChangeTime >= 5000)
  {
    g_ulChangeTime -= 5000;
    g_iCurrentAnim++;

    setAnim(g_iCurrentAnim);
  }

  drawMatrix8x8();
}

